/**
 * 手动执行数据库迁移脚本
 * 用法: node scripts/run-migrations.js
 */

import { initDB, closeDB } from '../shared/db/index.js'
import { runMigrations } from '../shared/db/migrations/migration-system.js'

async function main() {
  try {
    console.log('初始化数据库...')
    initDB()
    
    console.log('执行迁移...')
    runMigrations()
    
    console.log('迁移完成')
  } catch (error) {
    console.error('迁移失败:', error)
    process.exit(1)
  } finally {
    closeDB()
  }
}

main()

